class InfoController < ApplicationController
  before_filter :spam_required, :only=>['contact_send']
  #layout "info/menu"
  caches_page :technology, :contact, :idea, :about, :show

  def sub_layout
    "info/menu"
  end

  def technology
    @page_title += " - Teknik"
  end

  def contact_send
    load_params_from_session
    
    @message = Email.new
    @message.created = Time.now
    @message.receiver = "tomasbjerre@yahoo.com"
    @message.message = params[:message][:message]
    @message.sender = params[:message][:sender]
    @message.subject = params[:message][:subject]
    
    if (@message.save)
      render :text => "Ditt meddelande har tagits emot, tack!";
    else
      render :partial => "contact_message"
    end
  end

  def contact
    @page_title += " - Kontakt"
  end

  def idea
    @page_title += " - Idé"
  end

  def about
    @page_title += " - Om oss"
  end

  def show
    @page_title += " - Information"
  end
end
